package cn.wyu.service;

import cn.wyu.dao.UserDao;
import cn.wyu.dao.UserDaoImpl;
import cn.wyu.pojo.User;

public class UserServiceImpl implements UserService {
    private UserDao ud = new UserDaoImpl();
    @Override
    public User findByLoginName(String loginName, String password) {
        User user = ud.findByLoginName(loginName);

        if(user != null)
        {
            //判断密码
            if(user.getPassword().equals(password))
            {
                //密码正确
                return  user;
            }
        }
        return null;
    }
}
